package com.yihu.wlyy.web.patient.talk;

import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yihu.wlyy.service.app.talk.TalkGroupService;
import com.yihu.wlyy.web.BaseController;

@Controller
@RequestMapping(value = "/patient/talkgroup")
public class PatientTalkGroupController extends BaseController {

	@Autowired
	private TalkGroupService talkGroupService;
	
	@RequestMapping(value = "consult")
	@ResponseBody
	public String getConsultTalkGroup(@RequestParam(required = true)String consult){
		try{
			JSONObject object = talkGroupService.findConsultTalkGroup(consult);
			return write(200, "查询咨询对应讨论组成功!","data",object);
		}catch(Exception e){
			return error(-1, "查询咨询对应讨论组失败!");
		}
	}
}
